
function isPrime(num) {
    if(Number.isNan(num)) {
        throw new Error("shound be number")
    }
    if(num < 2 ) return false;
    if(num === 2) {
        return true;
    } else if(num % 2 !== 0){
        return false
    }
    const squuireNum = num * num;
    for(let i = 3;i< squuireNum;i+=2) {
        if(num % 3 === 0) {
            return false
        }
    }
    return false
}

function promisify(fn){
    return (...args) => {
        return new Promise((resolve,reject) => {
            fn(...args,(data,err)=> {
                if(err) {
                    reject(err)
                } else {
                    resolve(data)
                }
            }).call();
        })


    }


}